package cn.gdcp.broadcast;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class WeatherAndTraffic extends BroadcastReceiver {
    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();

        if (action.equals("I")) {
            String weather = intent.getStringExtra("weather");
            int wendu = intent.getIntExtra("wendu", 0);
            Log.e("weather", "The weather" + weather + " wendu" + wendu);
        } else if (action.equals("U")) {
            String traffic = intent.getStringExtra("traffic");
            int time = intent.getIntExtra("time", 0);
            Log.e("traffic", "traffic is" + traffic + " time" + time);
        }


    }
}
